/*
 * Cardinalite.cpp
 *
 *  Created on: Jun 8, 2013
 *      Author: juliendubois
 */

#include "Cardinalite.h"

Cardinalite::Cardinalite_2D Cardinalite::getOppose(Cardinalite_2D card) {
	return	(card == Nord)		?	(Sud)		:
			(card == NordEst)	?	(SudOuest)	:
			(card == SudEst)	?	(NordOuest)	:
			(card == Sud)		?	(Nord)		:
			(card == SudOuest)	?	(NordEst)	:
									(SudEst)	;
}

bool Cardinalite::estOppose(Cardinalite_2D card1, Cardinalite_2D card2)	{
	return card1 == getOppose(card2);
}

Cardinalite::Cardinalite_3D Cardinalite::getOppose(Cardinalite_3D card) {
	return (card == Haut) ?	(Bas)	:
							(Haut)	;
}

bool Cardinalite::estOppose(Cardinalite_3D card1, Cardinalite_3D card2) {
	return card1 == getOppose(card2);
}
